import 'package:flutter/material.dart';
import 'package:flutter_todo_app/services/notification_services.dart';
import 'package:flutter_todo_app/services/themes_services.dart';
import 'package:get/get.dart';

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  var notifyHelper;

  @override
  void initState() {
    super.initState();

    notifyHelper = NotifyHelper();
    notifyHelper.initializeNotification();
    notifyHelper.requestIOSPermissions();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: _appBar(),
      body: Column(
        children: [
          Text(
            "themedata",
            style: TextStyle(fontSize: 30),
          )
        ],
      ),
    );
  }

  _appBar() {
    return AppBar(
      leading: GestureDetector(
        onTap: () {
          print('Flutter Click');
          ThemeServices().switchTheme();

notifyHelper.displayNotification(
  title:"Theme Changed",
  body: Get.isDarkMode?"Activated Dark Theme":"Activated Light Theme"


);



        },
        child: Icon(Icons.nightlight_round),
      ),
      actions: [
        Icon(Icons.person),
        SizedBox(
          width: 20,
        )
      ],
    );
  }
}
